<!DOCTYPE html>
<html lang="zh-cn">
    <head>
        <meta charset="utf-8" />
        <title>Toast - ESUI Demo</title>
        <meta http-equiv="X-UA-Compatible" content="IE=Edge">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="stylesheet" href="assets/google-code-prettify/prettify.css" />
        <link rel="stylesheet" href="assets/themes/standard.css" />
        <!--[if lt IE 9]>
        <link rel="stylesheet" href="assets/ie8.css" />
        <![endif]-->
    </head>
    <body>
        <div class="header">
            <h1 id="branding">ESUI - Toast</h1>
        </div>
        <div class="ui-g main-container">
            <div id="side-bar" class="ui-u-1-5">
                <ul id="navigator" class="ui-nav">
                </ul>
            </div>
            <div id="main" class="ui-u-4-5">
                <h2>Toast</h2>
                <p>全局报错。</p>
                <div class="example">
                    <h3>设置内容</h3>
                    <div class="row">
                        <textarea data-ui-id="messageContent" type="textarea" data-ui-type="TextBox"
                            data-ui-width="300" data-ui-height="200" placeholder="messageContent">&lt;strong&gt;标题：&lt;/strong&gt;这是提示信息
                        </textarea>
                    </div>
                    <div class="row">
                        <button type="button" id="op-show" class="ui-button">show default</button>
                        <button type="button" id="op-info" class="ui-button ui-button-info">show info</button>
                        <button type="button" id="op-alert" class="ui-button ui-button-warning">show alert</button>
                        <button type="button" id="op-success" class="ui-button ui-button-success">show success</button>
                        <button type="button" id="op-error" class="ui-button ui-button-danger">show error</button>
                    </div>
                    <div class="row">
                        <input data-ui-id="time" type="text" data-ui-type="TextBox" placeholder="显示时间" value="3000" data-ui-hint="ms"
                            data-ui-hint-type="suffix"/>
                        <button type="button" id="op-time" class="ui-button">Set Display Time</button>
                    </div>
                </div>
            </div>
        </div>
        <script src="assets/loader/esl.js"></script>
        <script src="config.js"></script>
        <script src="demo.js"></script>
        <script src="assets/google-code-prettify/prettify.js"></script>
        <script id="main-js">
        require(
            [
                'esui',
                'esui/Toast',
                'esui/TextBox',
                'esui/Tab',
                'demo'
            ],
            function (ui, toast) {
                ui.init();
                document.getElementById('op-show').onclick = function () {
                    var content = ui.get('messageContent').getValue();
                    toast.show(content).show();
                };
                document.getElementById('op-info').onclick = function () {
                    var content = ui.get('messageContent').getValue();
                    toast.info(content).show();
                };
                document.getElementById('op-alert').onclick = function () {
                    var content = ui.get('messageContent').getValue();
                    toast.alert(content).show();
                };
                document.getElementById('op-success').onclick = function () {
                    var content = ui.get('messageContent').getValue();
                    toast.success(content).show();
                };
                document.getElementById('op-error').onclick = function () {
                    var content = ui.get('messageContent').getValue();
                    toast.error(content).show();
                };
                document.getElementById('op-time').onclick = function () {
                    var content = ui.get('messageContent').getValue();
                    var time = ui.get('time').getValue();
                    toast.show(content, {duration: +time}).show();
                };
            }
        );
        </script>
        <script src="sitemap.js"></script>
    </body>
</html>
